////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2011-2012 www.iflytek.com. All Rights Reserved.
//  This software for customer relationship management system, developed by Noo team.
//  Software code and design for the team, copy rights reserved.
////////////////////////////////////////////////////////////////////////////////

package com.iflytek.ci.test;

import javax.sql.DataSource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests;

/**
 * Spring的支持数据库访问, 事务控制和依赖注入的JUnit4 集成测试基类.
 * 相比Spring原基类名字更短并保存了dataSource变量.
 *
 * 子类需要定义applicationContext文件的位置, 如:
 * @ContextConfiguration(locations = { "springconfig.xml" })
 * @author poplar.yfyang
 * @version 1.0 2012-10-30 3:32 PM
 * @since JDK 1.5
 */
public abstract class SpringTransactionalTestCase extends AbstractTransactionalJUnit4SpringContextTests {
	/**
	 * DataSource
	 */
	protected DataSource dataSource;

	/**
	 *   DataSource
	 * @param dataSource  database source
	 */
	@Override
	@Autowired
	public void setDataSource(DataSource dataSource) {
		super.setDataSource(dataSource);
		this.dataSource = dataSource;
	}
}
